<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TimeForing.ViewModels.TaskIndexViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
    $(function() {
        $("#treeview ul").treeview();
    });
    </script>
    <h2>
        Index</h2>
         <%= Html.ActionLink("Create New", "Create") %>
         <div id="treeview">
         <ul>
    <%
        foreach (var story in Model.Stories )
        {
            %>
            <li><%=Html.Encode (story.Name ) %>
            <ul>
            <%
                foreach (var task in story.Tasks )
                { %>
                    <li><%= Html.Encode ( task.Name)  %>&nbsp <%= Html.ActionLink("Edit", "Edit", new { id = task.TaskID })%></li>
              <%  }
             %>
            </ul></li>
<%        }
        
         %>
         </ul>
    </div>

</asp:Content>
